# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=py3-airium
pkgver=0.2.6
pkgrel=0
pkgdesc="Bidirectional HTML to Python Translator"
url="https://gitlab.com/kamichal/airium"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="pytest"
subpackages="$pkgname-pyc"
source="https://gitlab.com/kamichal/airium/-/archive/v$pkgver/airium-v$pkgver.tar.gz"
builddir="$srcdir/airium-v$pkgver/"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl

	# test_backward appears to be broken
	# tests omitted from test_main_entry require network usage
	# test_dependencies_message requires the package to be installed
	.testenv/bin/python3 -m pytest \
		--ignore tests/test_translation.py \
		--deselect tests/test_boiler_hello.py::test_backward \
		--deselect tests/test_main_entry.py::test_get_bad_content_type \
		--deselect tests/test_main_entry.py::test_translate_local_file \
		--deselect tests/test_main_entry.py::test_translate_remote_file \
		--deselect tests/test_when_no_deps.py::test_dependencies_message
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
9c71ca65b33eba7b95351ac6947e39d2e354fa9a178c552a7d3d9cac4bc6397cd9b97fe8e91b9616451a8e4c68c0149ab5b7d75cd82baf3d891a7d6a345a784a  airium-v0.2.6.tar.gz
"
